package com.dykj.fireFighting.server.socialUnit.dutymanger.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dykj.fireFighting.api.socialUnit.dutymanger.entity.DutyRecord;

import com.dykj.fireFighting.api.socialUnit.dutymanger.vo.DutyRecordVo;
import com.dykj.fireFighting.common.core.mapper.SuperMapper;
import com.dykj.fireFighting.common.core.vo.PageVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Description 值班记录表管理
 * @Author zly
 * @Date  2021-07-20 16:48:48
 */
public interface DutyRecordMapper extends SuperMapper<DutyRecord> {


    IPage<DutyRecord> queryList(Page page, @Param("params") HashMap<String, Object> params);

    DutyRecordVo getInfo(String code);

    @Select("select count(1) from duty_record where unit_shift_id=#{shiftId} and create_by=#{userId} and DATE_FORMAT(create_date,'%Y-%m-%d') = #{date}" )
    int selectCount(@Param("userId")String userId,@Param("shiftId")String shiftId,@Param("date")String date);

    int getDeductionScore(@Param("start") String start,@Param("end")String end,@Param("unitId")String unitId);
}
